function bubbleSort(arr) {
	let low = 0,high = arr.length-1;
	while(low < high){
		let status = 0
		for(let i=high;i>low;i--){
			if(arr[i]<arr[i-1]){
				let item1 = arr[i-1];
				arr[i-1] = arr[i];
				arr[i] = item1;
				status++;
			}
		}
		++low;
		for(let j=low;j<high;j++){
			if(arr[j]>arr[j+1]){
				let item2 = arr[j+1];
				arr[j+1] = arr[j];
				arr[j] = item2;
				status++;
			}
		}
		--high;
		console.log(arr);
		if(status === 0){return true;}
		else console.log(status);
	}
}
let arr = [ 1, 2, 2, 2, 3, 3, 3, 4, 4, 5, 6, 9, 44, 65 ];
bubbleSort(arr);